﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using Autofac;
using SIG.Infrastructure.Logging;
using SIG.Data.UnitOfWork;
using SIG.Infrastructure.Cache;

namespace SIG.Modules
{
    

    public class EFModule : Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterModule(new RepositoryModule());

            //builder.RegisterType(typeof(SigContext)).As(typeof(DbContext)).InstancePerLifetimeScope();
            builder.RegisterType(typeof(MainBCUnitOfWork)).As(typeof(IMainBCUnitOfWork)).InstancePerRequest();       
            builder.RegisterType<LoggingService>().As<ILoggingService>();
            builder.RegisterType<CacheService>().As<ICacheService>();

        }

    }
}